<?php
//$intOrderHeaderID = 18;
if (defined("SITE")){
	$strSite = SITE;
	//$strSite.sprintf("%08d",$intOrderHeaderID)
}
include (MODULE_SHOP_HOST . "/navigation/EmailHeader");
include (MODULE . "/action/qrySelectOrderHeader");
$intOrderCarriage = $myrow["Freight"];
unset($intTotal);
//STYLE='table-layout: fixed'?>
<link REL=stylesheet HREF='http://<?=$SERVER_NAME?>/shop.css'>
	<table width='600' height='1000' align='center' class='Normal' border='0'  bgcolor='White'>
	<tr align='left' valign='top'>
		<td colspan='6'  width='600' height='100'><img src='http://<?=$SERVER_NAME?>/images<?=SITE_SUFFIX?>/EmailHeader.jpg' width='600' align='top' border='0'/></td>
	</tr>

	<tr>
		<td colspan='6' align='center'  height='70'>
			<h1 class='orderheading'>Gift Voucher</h1>
		</td>
	</tr>
	<tr>
		<td colspan='3' align='left' class='Normal' height='40'>
			<b>Voucher Number:</b> V<?=$strSite.sprintf("%08d",$intOrderHeaderID)?>
		</td>
		<td colspan='3' align='right'  height='40'>
			<b>Dated:</b> <?=ReformatFromMySqlDate($myrow["InvoiceDate"])?>
		</td>
	</tr>
	

	<tr>
		<td colspan='3' valign='top'  height='170'>
			<br/><b>Gift Voucher For:</b>
			<br/><?=$myrow["ShipName"]?>
			<br/><?=$myrow["ShipAddress"]?><?

				if ($myrow["ShipAddress2"]){
					echo "<br/>".$myrow["ShipAddress2"];
				}?>

			<br/><?=$myrow["ShipCity"]?>
			<br/><?=$myrow["ShipRegion"]?>
			<br/><?=$myrow["ShipPostalCode"]?>
		</td>

		<td colspan='3' valign='top'>
			<br/>

		</td>
	</tr>

	<tr align='center' height='20'>
        <td align='left' width='230' colspan='4'>&nbsp;</td>
		<td align='left' width='260'><b></b></td>
		<td align='right' width='120'><b>Voucher Value (<?=CURRENCY?>)</b></td>
    </tr><?
	
	include (MODULE . "/action/qrySelectOrderDetails$SHOP_TYPE");
	do{
		/*
		echo "<tr align='right' bgcolor=\"".switch_background($boBG)."\">
	 		<td align='left' height='15' colspan='5'>
	 			&nbsp;
			</td>
			<td>".number_format($myrow["Amount"], 2, '.', '')."</td>
	    </tr>";
	    */
		$boBG = -1 - $boBG; //alternate $boBG values from -1 and 0
		$intTotal = number_format($intTotal + $myrow["Amount"], 2, '.', '');
		$intVatPayableTotal = number_format($intVatPayableTotal + $myrow["VatPayable"], 2, '.', '');
		$intNetTotalTotal = number_format($intNetTotalTotal + $myrow["NetTotal"], 2, '.', '');
		$intVATRate = $myrow["VatRate"];
	} while ($myrow = mysql_fetch_array($result));
	

	echo "

	<tr>
 		<td colspan='5'  height='20'>&nbsp;</td>
		<td align='right'><b>".CURRENCY.number_format($intTotal, 2, '.', '')."</b></td>
    </tr>";?>
    <tr>
    	<td colspan='6' align='center' >
    		To use this voucher: quote voucher number <?=$strSite.sprintf("%08d",$intOrderHeaderID)?><br/>
    		by calling <?=PHONE?>.
    	</td>
    </tr>

	<tr valign='bottom'>
 		<td colspan='6' align='center' class='small'>
			<?=COMPANY_REGISTERED_ADDRESS?>&nbsp;<?=VAT_NUMBER?>
		</td>
    </tr>
	
</table>